#ifndef _WMIREADER_H
#define _WMIREADER_H

/******************************************************************************
** @file	WMIReader.h
** @author  Nestor Felipe
**
** @date	Jul 30, 2010
**
** @desc	This class represents the final interface with the end user
**          here its define all methods for other applications.
**          			
**
******************************************************************************/

#include <string>
#include "WMIResult.h"
#include "WMIConnectionMng.h"
#include "RegistryManager.h"
#include "WFileDirectory.h"
#include "WDisk.h"
#include "WConstants.h"

class WMIReader
{
public:

	#define DLLCONNECTION __declspec(dllexport)
	/**
    * init default conexion to local machine
    *
    * @param void
	*
    */
	DLLCONNECTION WHResult*  initConexion();

	/**
    * init conexion with an user, password to authenticate to give hosname 
    *
    * @param user	- the user to authenticate
	* @param pass	- the password of the user for authenticate
	* @param host	- maybe a dir ip or a hostname of the computer to connect
    */
	DLLCONNECTION WHResult* initConexion(std::wstring user, std::wstring pass, std::wstring host);
	
	/**
    * get logical disk available for the operative system
    *
	* @param result	- to return the result of the all logical disk
    */
	__declspec(dllexport) WHResult* getRootDirectories(WMIResult<WDisk>& result);

	/**
    * obtain the files inside the given path
    *
    * @param path	- the path to list the files.
    */
	__declspec(dllexport) WHResult* getFiles(std::wstring path,WMIResult<WFileDirectory> & resultD);

	/**
    * get all proccess of the host.
    *
	* @param proccess	- to return the result of the proccess
    */
	#define DLLPROCESS __declspec(dllexport)
	DLLPROCESS WMIResult<WProcess>* getProccesses();
	
	/**
    * Load all proccess of the host in a list.
    *
	* @param listProccesses 
    */
	DLLPROCESS WHResult* getProccesses(WMIResult<WProcess> &listProccesses);

	/**
    * get all files shared of the host.
    *
	* @param shares	- to return the result of the shares
    */
	#define DLLSHARE __declspec(dllexport)
	DLLSHARE WMIResult<WShare>* getShares();
	
    /**
    * Load all shares of the host in a list.
    *
	* @param listShares
    */
	DLLSHARE WHResult* getShares(WMIResult<WShare> &listShares);

	/**
    * get values of the registry of the system.
    *
    * @param path	- the path to list the content of the registry.
	* @param registry	- to return the result of the registry
    */
	__declspec(dllexport) void getRegistryChildren(wstring path, WMIResult<WRegistry>&);

	/**
	* Close the WMI Connection
	*/
	__declspec(dllexport) int closeConnection();

public:
	/**
	* For manage registry connection
	*/
	WMIConnection registryConnection;

	/**
	* for manage other connections
	*/
	WMIConnection wmi_connection;	
};

#endif
